package com.alan.prototype;

/**
 * Created by Alan on 2018/8/23.
 */
public class Test {

    public static void main(String[] args) throws CloneNotSupportedException {
        Prototype prototype = new Prototype();
        prototype.setName("张三");
        prototype.setPerson(new Person().setName("大人物"));

        Prototype clonePrototype = prototype.copy();


        clonePrototype.setName("李四");
        clonePrototype.getPerson().setName("啦啦啦");
        clonePrototype.setPerson(new Person().setName("大小"));
    }
}
